package com.rfid.emergencywarehouse.adapter;

import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.rfid.base.base.BaseAdapter;
import com.rfid.emergencywarehouse.R;
import com.rfid.emergencywarehouse.entity.WorkAre;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class KfAdapter extends BaseAdapter<KfAdapter.MyHolder, WorkAre> {


    public KfAdapter(List<WorkAre> data) {
        super(data);
    }

    @Override
    protected int getLayout() {
        return R.layout.item_kf;
    }

    @Override
    protected MyHolder getViewHolder(View view) {
        return new MyHolder(view);
    }

    @Override
    protected void bindView(MyHolder holder, int position, WorkAre t) {
        WorkAre asset = mData.get(position);
        holder.kf.setText("库房：" +asset.getFromWorkAreaName());
        holder.cnt.setText("待领取：" + asset.getBarCodePickingCount());
    }


    class MyHolder extends RecyclerView.ViewHolder{
        @BindView(R.id.kf)
        TextView kf;
        @BindView(R.id.cnt)
        TextView cnt;
        public MyHolder(@NonNull View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
